home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Hyper / P / Palette.cpt / Palette Stack / cards.xml < prev    next >
Text File  |  1992-08-17  |  15KB  |  270 lines

  1. card_2229.xml
  2. <?xml version="1.0" encoding="utf-8" ?>
  3. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  4. <card>
  5.     <id>2229</id>
  6.     <filler1>0</filler1>
  7.     <bitmap>BMAP_2474.pbm</bitmap>
  8.     <cantDelete> <false /> </cantDelete>
  9.     <showPict> <true /> </showPict>
  10.     <dontSearch> <false /> </dontSearch>
  11.     <owner>2752</owner>
  12.     <link rel="stylesheet" type="text/css" href="stylesheet_3100.css" />
  13.     <part>
  14.         <id>1</id>
  15.         <type>button</type>
  16.         <visible> <true /> </visible>
  17.         <reserved5> 0 </reserved5>
  18.         <reserved4> 0 </reserved4>
  19.         <reserved3> 0 </reserved3>
  20.         <reserved2> 0 </reserved2>
  21.         <reserved1> 0 </reserved1>
  22.         <enabled> <true /> </enabled>
  23.         <rect>
  24.             <left>262</left>
  25.             <top>99</top>
  26.             <right>422</right>
  27.             <bottom>219</bottom>
  28.         </rect>
  29.         <style>rectangle</style>
  30.         <showName> <false /> </showName>
  31.         <highlight> <false /> </highlight>
  32.         <autoHighlight> <false /> </autoHighlight>
  33.         <sharedHighlight> <true /> </sharedHighlight>
  34.         <family>0</family>
  35.         <titleWidth>0</titleWidth>
  36.         <icon>0</icon>
  37.         <textAlign>center</textAlign>
  38.         <font>Chicago</font>
  39.         <textSize>12</textSize>
  40.         <textStyle>plain</textStyle>
  41.         <name>Picture</name>
  42.         <script>on mouseUpglobal CustomPaletteif not CustomPalette thenpalette set, Alexput true into CustomPaletteput "Custom Palette" into line one of cd field 1elsepalette set, 128put false into CustomPaletteput "Standard Palette" into line one of cd field 1end iflock screenunlock screenopencardend mouseUp</script>
  43.     </part>
  44.     <part>
  45.         <id>2</id>
  46.         <type>field</type>
  47.         <visible> <true /> </visible>
  48.         <dontWrap> <false /> </dontWrap>
  49.         <dontSearch> <false /> </dontSearch>
  50.         <sharedText> <false /> </sharedText>
  51.         <fixedLineHeight> <false /> </fixedLineHeight>
  52.         <autoTab> <false /> </autoTab>
  53.         <lockText> <true /> </lockText>
  54.         <rect>
  55.             <left>235</left>
  56.             <top>221</top>
  57.             <right>444</right>
  58.             <bottom>249</bottom>
  59.         </rect>
  60.         <style>transparent</style>
  61.         <autoSelect> <false /> </autoSelect>
  62.         <showLines> <false /> </showLines>
  63.         <wideMargins> <false /> </wideMargins>
  64.         <multipleLines> <false /> </multipleLines>
  65.         <reservedFamily> 0 </reservedFamily>
  66.         <titleWidth>0</titleWidth>
  67.         <icon>0</icon>
  68.         <textAlign>center</textAlign>
  69.         <font>Monaco</font>
  70.         <textSize>9</textSize>
  71.         <textStyle>plain</textStyle>
  72.         <textHeight>12</textHeight>
  73.         <name></name>
  74.         <script></script>
  75.     </part>
  76.     <part>
  77.         <id>3</id>
  78.         <type>button</type>
  79.         <visible> <true /> </visible>
  80.         <reserved5> 0 </reserved5>
  81.         <reserved4> 0 </reserved4>
  82.         <reserved3> 0 </reserved3>
  83.         <reserved2> 0 </reserved2>
  84.         <reserved1> 0 </reserved1>
  85.         <enabled> <true /> </enabled>
  86.         <rect>
  87.             <left>445</left>
  88.             <top>295</top>
  89.             <right>510</right>
  90.             <bottom>341</bottom>
  91.         </rect>
  92.         <style>transparent</style>
  93.         <showName> <true /> </showName>
  94.         <highlight> <false /> </highlight>
  95.         <autoHighlight> <true /> </autoHighlight>
  96.         <sharedHighlight> <true /> </sharedHighlight>
  97.         <family>0</family>
  98.         <titleWidth>0</titleWidth>
  99.         <icon>21449</icon>
  100.         <textAlign>center</textAlign>
  101.         <font>Chicago</font>
  102.         <textSize>12</textSize>
  103.         <textStyle>plain</textStyle>
  104.         <name>Go Back</name>
  105.         <script>on mouseUpgo next cardend mouseUp</script>
  106.     </part>
  107.     <content>
  108.         <layer>card</layer>
  109.         <id>2</id>
  110.         <text>Standard PaletteClick Picture to Change Palettes</text>
  111.     </content>
  112.     <name></name>
  113.     <script>on opencardglobal CustomPaletteif CustomPalette is empty thenput false into CustomPaletteend ifshowpict Alex,item 1 of rect of cd btn 1 & "," & item 2 of rect of¬¨cd btn 1pass opencardend opencardon closecardglobal CustomPalettepalette s, 128put false into CustomPaletteput "Standard Palette" into line one of cd field 1end closecard</script>
  114. </card>
  115.  
  116.  
  117. card_2924.xml
  118. <?xml version="1.0" encoding="utf-8" ?>
  119. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  120. <card>
  121.     <id>2924</id>
  122.     <filler1>0</filler1>
  123.     <bitmap>BMAP_3587.pbm</bitmap>
  124.     <cantDelete> <false /> </cantDelete>
  125.     <showPict> <true /> </showPict>
  126.     <dontSearch> <false /> </dontSearch>
  127.     <owner>2752</owner>
  128.     <link rel="stylesheet" type="text/css" href="stylesheet_3100.css" />
  129.     <part>
  130.         <id>1</id>
  131.         <type>field</type>
  132.         <visible> <true /> </visible>
  133.         <dontWrap> <false /> </dontWrap>
  134.         <dontSearch> <false /> </dontSearch>
  135.         <sharedText> <false /> </sharedText>
  136.         <fixedLineHeight> <true /> </fixedLineHeight>
  137.         <autoTab> <false /> </autoTab>
  138.         <lockText> <true /> </lockText>
  139.         <rect>
  140.             <left>236</left>
  141.             <top>50</top>
  142.             <right>510</right>
  143.             <bottom>293</bottom>
  144.         </rect>
  145.         <style>scrolling</style>
  146.         <autoSelect> <false /> </autoSelect>
  147.         <showLines> <false /> </showLines>
  148.         <wideMargins> <false /> </wideMargins>
  149.         <multipleLines> <false /> </multipleLines>
  150.         <reservedFamily> 0 </reservedFamily>
  151.         <titleWidth>0</titleWidth>
  152.         <icon>0</icon>
  153.         <textAlign>left</textAlign>
  154.         <font>Palatino</font>
  155.         <textSize>12</textSize>
  156.         <textStyle>plain</textStyle>
  157.         <textHeight>16</textHeight>
  158.         <name>The Text</name>
  159.         <script></script>
  160.     </part>
  161.     <part>
  162.         <id>3</id>
  163.         <type>button</type>
  164.         <visible> <true /> </visible>
  165.         <reserved5> 0 </reserved5>
  166.         <reserved4> 0 </reserved4>
  167.         <reserved3> 0 </reserved3>
  168.         <reserved2> 0 </reserved2>
  169.         <reserved1> 0 </reserved1>
  170.         <enabled> <true /> </enabled>
  171.         <rect>
  172.             <left>378</left>
  173.             <top>295</top>
  174.             <right>443</right>
  175.             <bottom>341</bottom>
  176.         </rect>
  177.         <style>transparent</style>
  178.         <showName> <true /> </showName>
  179.         <highlight> <false /> </highlight>
  180.         <autoHighlight> <true /> </autoHighlight>
  181.         <sharedHighlight> <true /> </sharedHighlight>
  182.         <family>0</family>
  183.         <titleWidth>0</titleWidth>
  184.         <icon>16735</icon>
  185.         <textAlign>center</textAlign>
  186.         <font>Chicago</font>
  187.         <textSize>12</textSize>
  188.         <textStyle>plain</textStyle>
  189.         <name>Show Source</name>
  190.         <script>on mouseUpif the visible of cd field "Source" is true thenhide cd field "Source"set the name of me to "Show Source"elseset the name of me to "Hide Source"show cd field "Source"end ifend mouseUp</script>
  191.     </part>
  192.     <part>
  193.         <id>4</id>
  194.         <type>field</type>
  195.         <visible> <false /> </visible>
  196.         <dontWrap> <true /> </dontWrap>
  197.         <dontSearch> <false /> </dontSearch>
  198.         <sharedText> <false /> </sharedText>
  199.         <fixedLineHeight> <false /> </fixedLineHeight>
  200.         <autoTab> <false /> </autoTab>
  201.         <lockText> <true /> </lockText>
  202.         <rect>
  203.             <left>236</left>
  204.             <top>50</top>
  205.             <right>510</right>
  206.             <bottom>293</bottom>
  207.         </rect>
  208.         <style>scrolling</style>
  209.         <autoSelect> <false /> </autoSelect>
  210.         <showLines> <false /> </showLines>
  211.         <wideMargins> <false /> </wideMargins>
  212.         <multipleLines> <false /> </multipleLines>
  213.         <reservedFamily> 0 </reservedFamily>
  214.         <titleWidth>0</titleWidth>
  215.         <icon>0</icon>
  216.         <textAlign>left</textAlign>
  217.         <font>Monaco</font>
  218.         <textSize>9</textSize>
  219.         <textStyle>plain</textStyle>
  220.         <textHeight>12</textHeight>
  221.         <name>Source</name>
  222.         <script>on mouseupsend mouseup to cd btn id 3end mouseup</script>
  223.     </part>
  224.     <part>
  225.         <id>5</id>
  226.         <type>button</type>
  227.         <visible> <true /> </visible>
  228.         <reserved5> 0 </reserved5>
  229.         <reserved4> 0 </reserved4>
  230.         <reserved3> 0 </reserved3>
  231.         <reserved2> 0 </reserved2>
  232.         <reserved1> 0 </reserved1>
  233.         <enabled> <true /> </enabled>
  234.         <rect>
  235.             <left>445</left>
  236.             <top>295</top>
  237.             <right>510</right>
  238.             <bottom>341</bottom>
  239.         </rect>
  240.         <style>transparent</style>
  241.         <showName> <true /> </showName>
  242.         <highlight> <false /> </highlight>
  243.         <autoHighlight> <true /> </autoHighlight>
  244.         <sharedHighlight> <true /> </sharedHighlight>
  245.         <family>0</family>
  246.         <titleWidth>0</titleWidth>
  247.         <icon>24830</icon>
  248.         <textAlign>center</textAlign>
  249.         <font>Chicago</font>
  250.         <textSize>12</textSize>
  251.         <textStyle>plain</textStyle>
  252.         <name>Test XFCN</name>
  253.         <script>on mouseUpgo next cardend mouseUp</script>
  254.     </part>
  255.     <content>
  256.         <layer>card</layer>
  257.         <id>1</id>
  258.         <text><span class="style1">alette is a simple XCMD which changes the current color palette on your machine. Why?? Well simple, what if you were doing QuickTime movies (like I was) and your target only had 8 bit video cards. QuickTime does not remap the Color LookUp Table (CLUT) it, instead, dithers it's colors and there is a noticable degradation in color quality on some video, which as a rule is 16 bit color. Palette can extract the best 256 colors and build a color palette which is stored in the resource fork of the stack. It can then change the systems color palette so that when the picture is displayed it looks best it can on an 8 bit monitor.</span><span class="style3">Syntax looks like this:</span><span class="style1"></span><span class="style4">Palette <[G]et>, <Name, ID,"Clipboard">, NamePalette <[S]et>,<Name, ID></span><span class="style1">Get tells the XCMD to find a Picture either by Name, ID, or on the Clipboard and make a Palette. It then writes the Palette out to the stacks resource fork, and names it. (i.e. Palette Get, Rush or Palette G, 11868, Rush or Palette Get, Clipboard, Rush ).Set will take the pltt resource either by name or ID number and make it the current palette. (i.e. Palette S, 11868 or Palette Set, Rush).</span><span class="style3">System Requirements:</span><span class="style1">Must have System 7 to run this XCMD, I do not check for it, it is your responsibility, it will crash on a non System 7 machine.</span><span class="style3">Liscensing:</span><span class="style1">This software is shareware. And I am not greedy, I want 5% of any money you make off of software using this XCMD or 10 dollars which ever is smaller. (This means that if you make nothing off your software you owe me nothing.) If you make a killing send me the 10 bucks.</span><span class="style3">Source Code:</span><span class="style1">You are free to use the source code provided in anyway you see fit. If you change it (and you will have to to make it run) you must remove my name from the copyright.JerSquard Software3737 N. Country Club Dr. Ste. 218-STucson, AZ 85716email 'jersquard@aol.com'</span></text>
  259.     </content>
  260.     <content>
  261.         <layer>card</layer>
  262.         <id>4</id>
  263.         <text> /* Palette ¬©1992 Jer^2 Software, Jerome Jahnke        Name:        Palette        Type:        XCMD        ID:            21000    If you use this code remove my name from the copyright.        */    #include <HyperXCmd.h>#include <HyperXUtils.h>#include <ToolUtils.h>#include <Scrap.h>#include <PictUtil.h>#include <Palettes.h>/* Other Declarations */    #define _FromWho_     (char *)        "Palette ¬©1991 Jer^2 Software, Jerome Jahnke -- Compiled on " __DATE__ " at " __TIME__ " MST."    #define _HowTo_     (char *)        "The Correct Form is: \"Palette <[G]et,[S]et>, <Name,[ID,Name],[Clipboard,Name]> \""    #define _Version_    (char *)        "1.0"/* Function Declaration */        pascal    void    EntryPoint( XCmdPtr paramPtr );                void    Get_Palette( XCmdPtr paramPtr );                void    Set_Palette( XCmdPtr paramPtr );                /*    Routines CheckParamNumber, and CopyStrToHand are routines I have developed    to help make XThingees easier.        CheckParamNumber checks the value in paramPtr->paramCount to make sure it    falls between the two numbers, inclusive. It also checks for a <! = About,    ? = Help, or @ = Version> and returns a Zero if all it OK.        CopyStrToHand just takes the pString and copies it into a Handle, removing    the length byte and adding a terminating NULL to the end. I use it with     string constants becuase it is easier.*/pascal void EntryPoint(paramPtr)    XCmdPtr        paramPtr;{    int    i;        if (paramPtr->paramCount > -1)    {        if (i = CheckParamNumber(paramPtr,2,3))        {            switch(i)            {                case 1:    paramPtr->returnValue = CopyStrToHand(_FromWho_);                        break;                case 2:    paramPtr->returnValue = CopyStrToHand(_HowTo_);                        break;                case 3: paramPtr->returnValue = CopyStrToHand(_Version_);                        break;            }            return;        }    if( **(paramPtr->params[0]) == 'G' || **(paramPtr->params[0]) == 'g' )        Get_Palette( paramPtr );    else if( **(paramPtr->params[0]) == 'S' || **(paramPtr->params[0]) == 's' )        Set_Palette( paramPtr );    else        paramPtr->returnValue = CopyStrToHand(_HowTo_);    }}void Set_Palette( paramPtr )    XCmdPtr            paramPtr;{    char            TempStr[256];    PaletteHandle    ThePalette;    WindowPtr        CardWindow;    Rect            TempRect = { 0, 0, 10, 10 };    GrafPtr            OldPort;    short            theID;    ResType            theType;        HLock( paramPtr->params[1] );    ReturnToPas( paramPtr, *(paramPtr->params[1]), TempStr );    HUnlock( paramPtr->params[1] );    ThePalette = (PaletteHandle)GetNamedResource( 'pltt', TempStr );    if (!ThePalette)    {        ThePalette = GetNewPalette( (short)StrToNum( paramPtr, TempStr ) );        if (!ThePalette)        {            paramPtr->returnValue = CopyStrToHand( "\pCan't Find the pltt resource" );            return;        }    }    else    {        GetResInfo((Handle)ThePalette,&theID,&theType,&TempStr);        ReleaseResource( (Handle) ThePalette );        ThePalette = GetNewPalette( theID );    }    CardWindow = NewCWindow( (Ptr)0L,&TempRect,"\p", false ,documentProc, (WindowPtr) -1L,false,0L);    ShowWindow( CardWindow );    GetPort( &OldPort );    SetPort( CardWindow );    SetPalette( CardWindow, ThePalette, true );    SetPort( OldPort );    DisposeWindow( CardWindow );    DisposePalette( ThePalette );}    void Get_Palette( paramPtr )    XCmdPtr            paramPtr;{    char            TempStr[256];    PicHandle        ThePicture;    int                ResID, ResFileID;    long            length, offset;    PictInfo        ThePictInfo;            HLock( paramPtr->params[1] );    ReturnToPas( paramPtr, *(paramPtr->params[1]), TempStr );    HUnlock( paramPtr->params[1] );    if( StringEqual( paramPtr, TempStr, "\pCLIPBOARD") )    {        ThePicture = (PicHandle)NewHandle(0);        length = GetScrap((Handle)ThePicture,'PICT',&offset);        if ( length < 0 )        {            paramPtr->returnValue = CopyStrToHand( "\pNo Picture on Clipboard" );            return;        }                HLock( paramPtr->params[2] );        ReturnToPas( paramPtr, *(paramPtr->params[2]), TempStr );        HUnlock( paramPtr->params[2] );    }    else    {        ThePicture = (PicHandle)GetNamedResource( 'PICT', TempStr );        if (!ThePicture)        {            ThePicture = GetPicture( (short)StrToNum( paramPtr, TempStr ) );            if (!ThePicture)            {                paramPtr->returnValue = CopyStrToHand( "\pCan't Find the PICT resource" );                return;            }            else            {                HLock( paramPtr->params[2] );                ReturnToPas( paramPtr, *(paramPtr->params[2]), TempStr );                HUnlock( paramPtr->params[2] );            }        }    }    if( GetPictInfo( ThePicture, &ThePictInfo, returnPalette, 256, systemMethod, 0 ) )    {        paramPtr->returnValue = CopyStrToHand( "\pHaving a problem getting PICTInfo" );        return;    }    ResFileID = CurResFile();    ResID = UniqueID('pltt');    AddResource( (Handle)(ThePictInfo.thePalette), 'pltt', ResID, TempStr );    UpdateResFile( ResFileID );    DisposePalette( (ThePictInfo.thePalette) );}</text>
  264.     </content>
  265.     <name></name>
  266.     <script></script>
  267. </card>
  268.  
  269.  
  270.